//
//  EVEAPI.h
//  iEVEMon
//
//  Created by Scott Guyer on 3/22/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "Character.h";


//
//  This interface can only handle one outstanding request
// per instance.
//
@interface EVEApi : NSObject 
{
	NSString*             userID;
	NSString*             apiKey;	
	NSString*             charID;
	NSMutableData*        data;
	NSInteger             statusCode;
	int                   requestType;
	id                    responseDelegate;
	SEL                   responseSelector;
	NSURLConnection*      conn;
}

@property(retain,nonatomic) NSString* userID;
@property(retain,nonatomic) NSString* apiKey;
@property(retain,nonatomic) NSString* charID;
@property(assign,nonatomic) int requestType;
@property(retain,nonatomic) NSMutableData* data;
@property(assign,nonatomic) NSInteger statusCode;

- (id) init ;
- (id) initWithUser:(NSString*)uid andKey:(NSString*)key ;
- (void) setResponseDelegate:(id)delegate ;
- (void) getCharacters:(SEL)sel ;
- (void) getCharacter:(NSString*)charID withCallback:(SEL)sel ;
- (void) getTrainingSkill:(NSString*)charID withCallback:(SEL)sel ;
- (void) cancel ;

@end

enum {
	EVEAPIRequestTypeCharacterList = 1,
	EVEAPIRequestTypeCharacter = 2,
	EVEAPIRequestTypeSkillInTraining = 3
};

